package com.huawei.appgallery.wishlist.ui.cardkit.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.huawei.appgallery.foundation.card.base.bean.BaseDistCardBean;
import com.huawei.appgallery.foundation.card.base.normal.bean.NormalCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.framework.widget.NoAdaptRenderImageView;
import o.cgz;
import o.dce.e;
import o.dch;
import o.dcy;
import o.eqx;

public class WishAppsCard extends WishNormalCard {
    private TextView ʻ;
    private NoAdaptRenderImageView ॱॱ;
    private TextView ᐝ;

    public WishAppsCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ॱॱ = (NoAdaptRenderImageView) view.findViewById(e.ˋˊ);
        this.ᐝ = (TextView) view.findViewById(e.ˊˊ);
        this.ʻ = (TextView) view.findViewById(e.ˉ);
        return super.ˏ(view);
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        dcy o_dcy = (dcy) cardBean;
        ˋ(this.ʻ, o_dcy.ˋʻ());
        ˊ(o_dcy);
    }

    private void ˊ(dcy o_dcy) {
        if ((o_dcy.ˌ() & 4) != 0) {
            ˉ().setClickable(false);
        }
    }

    public void x_() {
        dcy o_dcy = (dcy) this.ˊᐝ;
        if (4 == o_dcy.ͺ()) {
            CharSequence ˎͺ = o_dcy.ˎͺ();
            if (TextUtils.isEmpty(ˎͺ)) {
                this.ˉ.setVisibility(8);
                return;
            } else {
                this.ˉ.setText(ˎͺ);
                return;
            }
        }
        super.x_();
    }

    public void ॱ(BaseDistCardBean baseDistCardBean) {
        if (this.ˊ != null) {
            this.ˊ.setVisibility(0);
            this.ˊ.setParam(baseDistCardBean);
            ॱ(this.ˊ.ॱ());
        }
    }

    protected void ˊ(NormalCardBean normalCardBean) {
        if (normalCardBean instanceof dcy) {
            dcy o_dcy = (dcy) normalCardBean;
            if (4 == o_dcy.ͺ()) {
                this.ˋ.setVisibility(8);
                return;
            } else if (o_dcy.ٴ() != 0) {
                this.ˋ.setVisibility(8);
                this.ॱॱ.setVisibility(0);
                this.ᐝ.setVisibility(0);
                this.ᐝ.setText(o_dcy.ߴ());
                eqx.ˏ(this.ॱॱ, o_dcy.ՙ(), "iconflag");
                return;
            } else {
                this.ॱॱ.setVisibility(8);
                this.ᐝ.setVisibility(8);
                if (TextUtils.isEmpty(o_dcy.ˎͺ())) {
                    this.ˋ.setVisibility(8);
                    return;
                }
                this.ˋ.setVisibility(0);
                this.ˋ.setText(o_dcy.ˎͺ());
                return;
            }
        }
        dch.ˎ.ˊ("WishAppsCard", "the cardbean is illegal!");
    }
}
